{% import 'admin/layout.html' as layout with context -%}
{% import 'admin/static.html' as admin_static with context %}
<!DOCTYPE html>
<html>
    <head>
        <title>{% block title %}{% if admin_view.category %}{{ admin_view.category }} - {% endif %}{{ admin_view.name }} - {{ admin_view.admin.name }}{% endblock %}</title>

        {% block head_meta %}
            <meta charset="UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta name="description" content="">
            <meta name="author" content="">
        {% endblock %}

        {% block head_css %}
            <link href="{{ url_for('static', filename='vendor/admin-lte/bootstrap/css/bootstrap.min.css')}}" rel="stylesheet">
            <link href="{{ url_for('static', filename='vendor/admin-lte/plugins/select2/select2.min.css')}}" rel="stylesheet">
            <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
            <link href="{{ url_for('static', filename='vendor/admin-lte/dist/css/AdminLTE.min.css')}}" rel="stylesheet">
            <link href="{{ url_for('static', filename='vendor/admin-lte/dist/css/skins/_all-skins.min.css')}}" rel="stylesheet">
            <link href="{{ url_for('static', filename='css/flask-admin-lte.css')}}" rel="stylesheet">
        {% endblock %}

        {% block head %}{% endblock %}

        {% block head_tail %}{% endblock %}
    </head>

    <body class="{% block skin %}skin-blue{% endblock %} sidebar-mini">
        {% block page_body %}
            <div class="wrapper">
                <header class="main-header">
                    {% block brand %}
                    <a href="#" class="logo">
                        <span class="logo-lg">{{ admin_view.admin.name }}</span>
                    </a>
                    {% endblock %}
                    <nav class="navbar navbar-static-top">
                        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                            <span class="sr-only">Toggle navigation</span>
                        </a>
                    </nav>
                </header>
                <aside class="main-sidebar">
                    <section class="sidebar">
                        {% block main_menu %}
                            <ul class="sidebar-menu">
                                {{ layout.menu() }}
                            </ul>
                        {% endblock %}
                    </section>
                </aside>
                <div class="content-wrapper">
                    {% set render_ctx = h.resolve_ctx() %}

                    {% block messages %}
                        {{ layout.messages() }}
                    {% endblock %}

                    {% block body %}{% endblock %}
                </div>
                <footer class="main-footer">
                    <div class="pull-right hidden-xs">
                        {% block version %}
                        <b>Version</b> 0.0.1
                        {% endblock %}
                    </div>
                    {% block copyright %}<strong>Copyright © 2014-2015</strong> All rights reserved.{% endblock %}
                </footer>
            </div>
        {% endblock %}

        {% block tail_js %}
            <script src="{{ url_for('static', filename='vendor/admin-lte/plugins/jQuery/jQuery-2.2.3.min.js')}}" type="text/javascript"></script>
            <script src="{{ url_for('static', filename='vendor/admin-lte/plugins/select2/select2.full.min.js')}}" type="text/javascript"></script>
            <script src="{{ url_for('static', filename='vendor/admin-lte/bootstrap/js/bootstrap.min.js')}}" type="text/javascript"></script>
            <script src="{{ url_for('static', filename='vendor/moment/min/moment-with-locales.min.js')}}" type="text/javascript"></script>
            <script src="{{ url_for('static', filename='vendor/admin-lte/dist/js/app.js')}}" type="text/javascript"></script>
        {% endblock %}

        {% block tail %}{% endblock %}
    </body>
</html>